import request from '@/utils/request'

export function fetchList(params) {
  return request({
    url: '/question',
    method: 'get',
    params
  })
}

export function recommendExpert(params) {
  return request({
    url: '/question/recommendExpert',
    method: 'get',
    params
  })
}

// 查看结果列表
export function resultList(params) {
  return request({
    url: '/question/result',
    method: 'get',
    params
  })
}

export function fetchDetail(id) {
  return request({
    url: `/question/${id}`,
    method: 'get',
  })
}

export function create(data) {
  return request({
    url: '/question',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    url: '/question',
    method: 'put',
    data
  })
}

export function remove(id) {
  return request({
    url: `/question/${id}`,
    method: 'delete'
  })
}
